<?php
namespace Home\Controller;
use Think\Controller;
class CommonController extends Controller {
    public function __construct(){
      parent::__construct();
      $this->nav();
      $this->link();
      $this->news();
    }
    public function nav(){
      $cate=D('cate');
      $cateres=$cate->select();
      $this->assign('cateres',$cateres);
    }
    public function link(){
      $link=D('link');
      $linkres=$link->select();
      // var_dump($linkres);exit;
      $this->assign('linkres',$linkres);
    }
    public function news(){
      $art=D('article');
      $artres=$art->order('time desc')->limit(5)->select();
      $this->assign('arting',$artres);
    }
}
